home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / 8bit / cislib_b / othell < prev    next >
Text File  |  1995-04-22  |  7KB  |  118 lines

  1. 3 Q0=0:Q1=1:Q2=2:Q4=4:Q5=3:Q6=6:Q7=7:Q9=9:Q10=10:Q11=11:Q12=12:Q14=14:Q15=3000:Q17=5:Q18=15:Q31=31:Q35=35:Q40=40:Q42=42:Q44=44 
  2. 4 Q45=45:Q50=50:Q54=54:Q55=55:Q70=70:Q72=72:Q77=77:Q88=88:Q101=101:Q102=3100:Q120=120:Q200=3200:Q255=255:Q401=3400:Q501=8500 
  3. 5 Q740=3740:Q755=755:Q764=764 
  4. 35 Dim Board(Q101),P(Q101),Pie(Q1),Yesno$(Q2),Legal(Q9) 
  5. 40 Graphics Q2:? #Q6:? #Q6:? #Q6:? #Q6:? #Q6;"      OTHELLO" 
  6. 50 ? "DO YOU WANT INSTRUCTIONS (Y/N)"; 
  7. 51 If Peek(Q764)=Q35 Then ? :? :Goto 500 
  8. 52 If Peek(Q764)=43 Then Goto Q55 
  9. 53 Goto 51 
  10. 55 Graphics Q0 
  11. 60 ? "REVERSI is a game played on an 8 by 8 board by two players who alternately  place pieces to capture other "; 
  12. 70 ? "pieces." 
  13. 90 ? "Capturing is done by pinching your    opponent's pieces between your own.   A player must capture pieces if "; 
  14. 100 ? "      possible." 
  15. 120 ? "When players have no more captures,   the game ends. The player with more   pieces wins." 
  16. 130 ? "Choosing the location of your move is done by using the curser keys ";:  For X=28 To Q31:? Chr$(27);Chr$(X);:Next X 
  17. 150 ? "    when you are happy, press the space   bar and the computer will put your    piece on that location." 
  18. 160 ? "If you are not sure about how to play,when asked how many human players,    reply 0(zero) and you can "; 
  19. 170 ? "watch the   computer play itself" 
  20. 180 ? "If you cannot move, or you wish the   computer to move for you, press 'N'   and the move will be made." 
  21. 500 Poke Q764,Q255:? "HOW MANY HUMAN PLAYERS (0-2)"; 
  22. 510 If Peek(Q764)=Q255 Then 510 
  23. 520 If Peek(Q764)=Q50 Then Players=Q0:? "0" 
  24. 530 If Peek(Q764)=Q31 Then Players=Q1:? "1" 
  25. 540 If Peek(Q764)=30 Then Players=Q2:? "2" 
  26. 600 ? "STAND BY....." 
  27. 620 Data 0,0,0,0,0,0,0,0,0,0,0,7,2,6,6,6,6,2,7,0,0,2,1,3,3,3,3,1,2,0,0,6,3,4,4,4,4,3,6,0 
  28. 624 Data 0,6,3,4,4,4,4,3,6,0,0,6,3,4,4,4,4,3,6,0,0,6,3,4,4,4,4,3,6,0 
  29. 628 Data 0,2,1,3,3,3,3,1,2,0,0,7,2,6,6,6,6,2,7,0,0,0,0,0,0,0,0,0,0,0 
  30. 630   For X=Q0 To 99:Read Y:P(X)=Y:Next X 
  31. 640 Data -10,-9,1,11,10,9,-1,-11,0 
  32. 650   For X=Q1 To Q9:Read Y:Legal(X)=Y:Next X:Drawcell=8000:Drawcellp=8100:Grid=8400:Keyread=Q501:Autoplay=3700 
  33. 910 Let One=Q1:Zero=Q0:Pie(Zero)=Q2:Pie(One)=Q2 
  34. 2000 Graphics Q7:Setcolor Q1,Q4,8:Setcolor Q2,Q12,Q10:Poke 752,Q1:? "";:Setcolor Q5,Q4,Q4:Gosub Grid 
  35. 2030 P=Q1:Cell=Q44:Gosub Drawcellp:Cell=Q55:Gosub Drawcellp:P=Q2:Cell=Q45:Gosub Drawcellp:Cell=Q54:Gosub Drawcellp 
  36. 2100   For I=Q11 To Q88:Board(I)=Zero:Next I 
  37. 2110   For I=Zero To Q9:Board(I)=-Q1:Board(I+90)=-Q1:Board(I*Q10)=-Q1:Board(I*Q10+Q9)=-Q1:Next I 
  38. 2120 Board(Q44)=Q1:Board(Q55)=Q1:Board(Q45)=Q2:Board(Q54)=Q2:Curc=Q2:Curx=26:Cury=Q70:Gosub Drawcell 
  39. 2210 Curc=Q5:Curx=129:Cury=Q70:Gosub Drawcell 
  40. 3000 If Pie(Zero)+Pie(One)=64 Or Pie(One)=Zero Or Pie(Zero)=Zero Then 4000 
  41. 3005 Poke Q77,Q0:? "";"    ";Pie(One),,,"  ";Pie(Zero):If Curp=Zero Then ? " << TURN " 
  42. 3007 If Curp=One Then ? "  TURN >>" 
  43. 3010 Setcolor Q1+Curp,Q4,Q0:Sound Q0,Q255,Q10,Q10:  For Y=Q1 To Q40:Next Y:Setcolor Q1+Curp,Q4,Q14:Sound Q0,Q0,Q0,Q0 
  44. 3020 Setcolor Q1,Q4,Q4:Setcolor Q2,Q12,Q10:If Curp=Zero Then Setcolor Q0,Q4,Q4 
  45. 3023 If Curp=One Then Setcolor Q0,Q12,Q10 
  46. 3025 If Players=Zero Or Players=One And Curp=One Then Goto Autoplay 
  47. 3030 Curcell=Q44:Curx=Zero:Cury=Zero:Goto Q200 
  48. 3100 Gosub Keyread:If Dc=Zero Then Goto Q401 
  49. 3107 Curcell=Curcell+Dc:If Board(Curcell)=Zero Then Goto Q200 
  50. 3120 If Board(Curcell)<Zero Then Curcell=Curcell-Dc:Goto Q102 
  51. 3200 Color Shade:Plot Curx,Cury:Drawto Curx+Q2,Cury:Plot Curx,Cury+One:Drawto Curx+Q2,Cury+One 
  52. 3310 Cury=Int(Curcell/Q10):Curx=Curcell-Q10*Cury:Curx=Q44+Q10*(Curx-Q1):Cury=Q4+Q9*(Cury-Q1):Locate Curx,Cury,Shade 
  53. 3340 Color Shade+One:Plot Curx,Cury:Drawto Curx+Q2,Cury:Plot Curx,Cury+One:Drawto Curx+Q2,Cury+One 
  54. 3350 Sound Q0,Q50,Q10,Q10:  For X=Q1 To 20:Next X:Sound Q0,Q0,Q0,Q0:Goto Q102 
  55. 3400 If Board(Curcell)<>Q0 Then Goto Q200 
  56. 3450 Cell=Curcell:P=Curp+Q1:Gosub Drawcellp:Curp=One-Curp:Pie(Curp)=Pie(Curp)+One:Board(Curcell)=One-Curp+Q1 
  57. 3480 Curc=One-Curp+Q2:Gosub Drawcell:Total=Zero:Play=Zero 
  58. 3520 Play=Play+One:Incr=Legal(Play):If Incr<>Q0 Then Gosub 3600:Goto 3520 
  59. 3580 If Total=Zero Then Curp=Q1-Curp:Board(Curcell)=Q0:Curc=Q0:Gosub Drawcell:Goto Q200 
  60. 3590 Goto Q15 
  61. 3600 Spot=Q0:Pieces=Q0 
  62. 3610 Spot=Spot+Incr:If Board(Curcell+Spot)=One+Curp Then Pieces=Pieces+One:Goto 3610 
  63. 3620 If Board(Curcell+Spot)<>Board(Curcell) Or Pieces=Q0 Then Return  
  64. 3630 Spot=Spot-Incr 
  65. 3640 Cury=Int((Curcell+Spot)/Q10):Curx=Curcell+Spot-Q10*Cury:Board(Curcell+Spot)=Board(Curcell) 
  66. 3645 Pie(Curp)=Pie(Curp)+One:Pie(One-Curp)=Pie(One-Curp)-One:Curx=Q42+Q10*(Curx-Q1):Cury=Q2+Q9*(Cury-Q1) 
  67. 3660 P=One:Gosub Drawcell:Spot=Spot-Incr:Total=Total+One:If Spot=Zero Then Return  
  68. 3680 Goto 3640 
  69. 3700 Max=Zero:  For Curcell=Q11 To Q88:If Board(Curcell)<>Zero Then Goto Q740 
  70. 3711   Play=Zero:Poke Q755,Q5 
  71. 3712   Play=Play+One:Incr=Legal(Play):If Incr=Zero Then Goto Q740 
  72. 3713   If Board(Curcell+Incr)=Q1 Or Board(Curcell+Incr)=Q2 Then 3720 
  73. 3715   Goto 3712 
  74. 3720   Total=Zero:Play=Zero 
  75. 3725   Play=Play+One:Incr=Legal(Play):If Incr<>Q0 Then Gosub 3800:Goto 3725 
  76. 3728   If Total>Zero Then Total=Total+P(Curcell) 
  77. 3730   If Total>Max Then Cnew=Curcell:Max=Total 
  78. 3735   If Total=Max And Rnd(Zero)>0.5 Then Cnew=Curcell 
  79. 3740   Poke Q755,Q2:Next Curcell:Curcell=Cnew:If Max=Zero Then Curp=One-Curp:Goto Q15 
  80. 3750 Goto Q401 
  81. 3800 Spot=Zero:Pieces=Zero 
  82. 3810 Spot=Spot+Incr:If Board(Curcell+Spot)=Q2-Curp Then Pieces=Pieces+One:Goto 3810 
  83. 3820 If Board(Curcell+Spot)<>One+Curp Or Pieces=Zero Then Return  
  84. 3830 Spot=Spot-Incr 
  85. 3840 Spot=Spot-Incr:Total=Total+P(Curcell+Spot):If Spot=Zero Then Return  
  86. 3850 Goto 3840 
  87. 4000 Poke Q77,Q0:? "";"    ";Pie(One),,,"  ";Pie(Zero):If Pie(Zero)<Pie(One) Then ? "   <<  ":?  
  88. 4007 If Pie(Zero)>Pie(One) Then ? "     >>":?  
  89. 4008 If Pie(Zero)=Pie(One) Then ? "TIE GAME!!}}":Goto 4030 
  90. 4010 ? "THE WINNER WAS PLAYER #";:If Pie(One)>Pie(Zero) Then ? One 
  91. 4020 If Pie(One)<Pie(Zero) Then ? Q2 
  92. 4030 Poke Q764,Q255:? "ANOTHER GAME";:Input Yesno$:If Yesno$(Q1,Q1)="Y" Then Run  
  93. 4040 Graphics Q0:? :? "CALLING MENU.....":Run "D:MENU" 
  94. 8000 Color Curc:Plot Curx+Q2,Cury:Drawto Curx+Q4,Cury:Plot Curx+Q1,Cury+Q1:Drawto Curx+Q17,Cury+Q1 
  95. 8040 Plot Curx,Cury+Q2:Drawto Curx+Q6,Cury+Q2:Plot Curx,Cury+Q5:Drawto Curx+Q6,Cury+Q5 
  96. 8060 Plot Curx+Q1,Cury+Q4:Drawto Curx+Q17,Cury+Q4:Plot Curx+Q2,Cury+Q17:Drawto Curx+Q4,Cury+Q17:If P=Q0 Then Return  
  97. 8080   For I=Q10 To 200 Step Q10:Sound Q0,I,Q0,Q18:Next I:  For I=Q18 To Q0 Step 0.25:Sound Q0,210,Q0,I:Next I 
  98. 8090 Sound Q0,Q0,Q0,Q0:Return  
  99. 8100 Rem  
  100. 8110 Curc=P+Q1:Cury=Int(Cell/Q10):Curx=Cell-Q10*Cury:Curx=Q42+Q10*(Curx-Q1):Cury=Q2+Q9*(Cury-Q1):Goto Drawcell 
  101. 8400 Color Q1:  For Y=Q0 To Q72 Step Q9:Sound Q0,Y,Q10,Q10:Plot Q40,Y:Drawto Q120,Y:Next Y 
  102. 8430   For X=Q40 To Q120 Step Q10:Sound Q0,100+X,Q10,Q10:Plot X,Q0:Drawto X,Q72:Next X:Sound Q0,Q0,Q0,Q0:Return  
  103. 8500 Poke Q764,Q0:Dc=Zero 
  104. 8520 P=Peek(Q764):If P=Q6 Then Dc=-Q1 
  105. 8522 If Stick(Q0)=Q11 Then Dc=-Q1 
  106. 8530 If P=Q7 Then Dc=Q1 
  107. 8532 If Stick(Q0)=Q7 Then Dc=Q1 
  108. 8540 If P=Q18 Then Dc=Q10 
  109. 8542 If Stick(Q0)=13 Then Dc=Q10 
  110. 8550 If P=Q14 Then Dc=-Q10 
  111. 8552 If Stick(Q0)=Q14 Then Dc=-Q10 
  112. 8560 If P=33 Then Return  
  113. 8562 If Strig(Q0)=Q0 Then Return  
  114. 8565 If P=21 Then Gosub 5000:Goto Q501 
  115. 8567 If P=Q35 Then Color Shade:Plot Curx,Cury:Drawto Curx+Q2,Cury:Plot Curx,Cury+One:Drawto Curx+Q2,Cury+One:Goto 370 
  116. 8570 If Dc=Zero Then 8520 
  117. 8590 Return  
  118.